"""
des: 
author: 邵宁
date: 2022-09-09
"""
import json
import time
from util import path


class MsgTemplateBase:
    def __init__(self):
        self.msg_json = {}
        self.set_key_value("status", 200)
        self.set_key_value("desc", "描述信息")
        self.set_key_value("msg_id", path.get_file_name_random())
        self.set_key_value("msg_type", "info")
        self.set_key_value("msg_str", "返回的信息")
        self.set_key_value("data", None)
        self.set_key_value("time", time.strftime("%Y-%m-%d %H:%M:%S"))

    def set_key_value(self, key, value):
        self.msg_json[key] = value

    def get_json(self):
        return self.msg_json

    def get_json_dumps(self):
        return json.dumps(self.msg_json)


class MsgTemplateKojiPatternList(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateSessionInit(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateSessionSetting(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateSessionMsg(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateSessionList(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateForSPEC(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateForSpecList(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateForFileList(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateForRpmRelease(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateGitPull(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateFileDownload(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateForCompatibilityReport(MsgTemplateBase):
    def __init__(self):
        super().__init__()


class MsgTemplateForTask(MsgTemplateBase):
    def __init__(self):
        super().__init__()


if __name__ == '__main__':
    a = MsgTemplateKojiPatternList()
    print(a.get_json())
